package com.heima.wemedia.controller.v1;

import com.heima.model.admin.dtos.SensitiveDto;
import com.heima.model.admin.pojos.AdSensitive;
import com.heima.model.common.dtos.ResponseResult;
import com.heima.model.wemedia.pojos.WmSensitive;
import com.heima.wemedia.service.WmSensitiveService;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;

@RestController
@RequiredArgsConstructor
@Slf4j
@RequestMapping("/api/v1/sensitive")
public class WmSensitiveController {

    private final WmSensitiveService wmSensitiveService;

    @DeleteMapping("/del/{id}")
    public ResponseResult del(@PathVariable Integer id){
        return wmSensitiveService.del(id);
    }

    @PostMapping("/list")
    public ResponseResult list(@RequestBody SensitiveDto sensitiveDto){
        return wmSensitiveService.findlist(sensitiveDto);
    }

    @PostMapping("/save")
    public ResponseResult save(@RequestBody AdSensitive adSensitive){
        return wmSensitiveService.saveSensitive(adSensitive);
    }

    @PostMapping("/update")
    public ResponseResult update(@RequestBody AdSensitive adSensitive){
        return wmSensitiveService.updateSensitive(adSensitive);
    }


}
